const kindOptions = [
  { label: '发货仓', value: '1' },
  { label: '销退仓', value: '2' },
  { label: '次品仓', value: '3' },
]

const isOpenOptions = [
  { label: '自发', value: '0' }, 
	{ label: '代发', value: '1' }
]

const cityOptions1 = [
	{ label: '南通', value: '南通' }
]

const cityOptions2 = [
	{ label: '常熟', value: '常熟' },
	{ label: '织里', value: '织里' }
]

const stateOptions = [
  { label: '启用', value: '0' }, 
	{ label: '禁用', value: '1' }
]

//表单配置项
const formItemData = {
  'warehouseName': {
    itemConfig: {
      name: 'warehouseName'
    },
    elConfig: {
      formType: 'Input',
      placeholder: '仓库名称',
    }
  },
  'kind': {
    itemConfig: {
      name: 'kind'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '仓库类型',
      options: kindOptions
    }
  },
  'isOpen': {
    itemConfig: {
      name: 'isOpen'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '自发或代发',
      options: isOpenOptions
    }
  },
  'city': {
    itemConfig: {
      name: 'city'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '城市',
      options: APP_TITLE == '找家纺' ? cityOptions1 : cityOptions2
    }
  },
  'state': {
    itemConfig: {
      name: 'state'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '状态',
      options: stateOptions
    }
  },
  'logisticsName': {
    itemConfig: {
      name: 'logisticsName'
    },
    elConfig: {
      formType: 'Input',
      placeholder: '可用快递',
    }
  },
}

//处理表单数据
export const getFormItem = () => {
  const arr = [];
  Object.keys(formItemData).map(v => {
    arr.push(formItemData[v]);
  })
  return arr;
}
